package xcmg.device.dao.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.marketing.MarketingActivityDO;
import xcmg.device.dao.entity.marketing.PriceSearchReportDO;
import xcmg.device.service.vo.marketing.MarketingActivityPriceVO;
import xcmg.device.service.vo.marketing.MarketingActivityVO;
import xcmg.device.service.vo.marketing.SupplierPriceSchemeQeuryParamVO;
import xcmg.device.service.vo.marketing.SupplierPriceSchemeQueryResultVO;

import java.util.List;

@Mapper
public interface MarketingActivityMapper {
    int deleteByPrimaryKey(String id);

    Integer insert(MarketingActivityDO record);

    MarketingActivityDO item(String id);

    int update(MarketingActivityDO record);

    List<MarketingActivityDO> list(MarketingActivityVO recode);

    List<MarketingActivityPriceVO> activityList(@Param("dealerOrgId") String dealerOrgId, @Param("orgId") String orgId, @Param("materialsNo") String materialsNo);

    List<MarketingActivityPriceVO> activityList4Default(@Param("dealerOrgId") String dealerOrgId, @Param("orgId") String orgId,
                                                        @Param("materialsNo") String materialsNo, @Param("activityName") String activityName);

    List<MarketingActivityPriceVO> activityList4Batch(@Param("dealerOrgId") String dealerOrgId, @Param("orgId") String orgId,
                                                      @Param("materialsNos") List<String> materialsNos);

    MarketingActivityPriceVO activityPriceDetail(@Param("priceSchemeId") String priceSchemeId,@Param("materialsNo") String materialsNo);

    Integer nameCount(MarketingActivityDO record);

    Integer nameCountPirceGroup(MarketingActivityDO record);

    MarketingActivityDO findByPriceGroup(@Param("orgId") String orgId, @Param("priceGroup") String priceGroup);

    MarketingActivityDO findByName(@Param("orgId") String orgId, @Param("priceName") String priceName);

    MarketingActivityPriceVO activityModel(@Param("dealerOrgId") String dealerOrgId, @Param("orgId") String orgId, @Param("materialsNo") String materialsNo, @Param("priceGroup") String priceGroup);

    MarketingActivityPriceVO activityModelByName(@Param("materialsNo") String materialsNo, @Param("activityName") String activityName);

    int deleteForUpdate(@Param("orgId") String orgId);

    int batchInsert(List<MarketingActivityDO> list);

    int nextSeq();

    MarketingActivityDO activityDO(@Param("orgId") String orgId,@Param("activityId") String activityId);

    MarketingActivityPriceVO getAgentRetailPrice(@Param("name") String agentRetailPriceName, @Param("orgId") String orgId, @Param("materialsNo") String materialsNo);

    List<PriceSearchReportDO> priceSearchReportList(PriceSearchReportDO priceSearchReportDO);

    List<PriceSearchReportDO> priceSearchReportListForClient(PriceSearchReportDO priceSearchReportDO);

    List<SupplierPriceSchemeQueryResultVO> supplierPriceSchemeQuery(SupplierPriceSchemeQeuryParamVO paramVO);

    List<MarketingActivityDO> getPricePlan(@Param("oemOrgId") String oemOrgId, @Param("orgId") String orgId);

    MarketingActivityDO itemValid(String id);
    
    int mergeInto(MarketingActivityDO marketingActivityDO);
    
    MarketingActivityDO activityByName(@Param("orgId") String orgId, @Param("activityName") String activityName);
    
    List<MarketingActivityDO> syncErpList(String orgId);

    List<MarketingActivityPriceVO> queryYnPriceMap(@Param("materialsNos") List<String> materialsNos,@Param("orgId") String orgId);
}
